package com.real8.plusplayground.client.person;

import com.google.gwt.place.shared.Place;
import com.google.gwt.place.shared.PlaceTokenizer;
import com.google.gwt.place.shared.Prefix;

/**
 * The place in the application that shows a Person
 * 
 * @author Rutger van der Eijk
 * 
 */
public class PersonPlace extends Place {
	private String personId;

	public PersonPlace(String token) {
		personId = token;
	}

	public String getPersonId() {
		return personId;
	}

	@Prefix("pr")
	public static class Tokenizer implements PlaceTokenizer<PersonPlace> {
		@Override
		public PersonPlace getPlace(String token) {
			return new PersonPlace(token);
		}

		@Override
		public String getToken(PersonPlace place) {
			return place.getPersonId();
		}
	}
}
